home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Clinical Endocrinology
/
Clinical Endocrinology.iso
/
pc
/
00000000
/
history.dir
/
00003_Script_3
< prev
next >
Wrap
Text File
|
1995-11-09
|
4KB
|
138 lines
-- This handler is called from the parent movie when
-- the instruction to navigate to a new movie is given.
-- It stores the movie reference as a global.
-- This reference is taken from the grey line in the
-- movie's menu text. The movie's pathname is also stored.
-- With these globals it builds a list of movies which
-- have been visited. Each variable is stored in a
-- different field. The reference field is visible to
-- the user, and the pathname field is kept hidden.
on updateHistory
global lastpathName, movieRef, greyLine
put the text of field "History Field" into oldText
if oldText = "" then
put movieRef into oldText
else
put movieRef & RETURN before oldtext
end if
put oldText into field "History Field"
setTextFormat
put the text of field "Pathname Field" into oldText
if oldText = "" then
put lastpathName into oldText
else
put lastpathName & RETURN before oldtext
end if
put oldText into field "Pathname Field"
put the number of lines in field "Pathname Field" into theLines
if theLines > 20 then
delete line 1 of field "Pathname Field"
delete line 1 of field "History Field"
end if
hiliteNewLine
end updateHistory
------------------------------------------------------
-- Handler which takes a global which is a refernce to a line
-- in a text castmember which represents a pathname. This is
-- either the last line, by default, or a user defined line.
-- It takes the pathname and instructs the stage/parent window
-- to jump to the new movie. Handlers are called to redefine
-- the history list.
on goToHistory
global lineSelected
if voidP(lineSelected) then
alert "Sorry, nowhere to go!"
abort
end if
put the text of field "Pathname Field" into theText
if theText = "" then
alert "Sorry, nowhere to go!"
abort
end if
put line lineSelected of theText into newPath
--put word 1 of line lineSelected of field "Frame Field" into theFrame
--scrubPaths
--scrubMovieRefs
tell the stage
go movie newPath
end tell
hiliteNewLine
end gotoHistory
------------------------------------------------------
-- Handler to delete all lines before the selection
on scrubPaths
global lineSelected
put the text of field "Pathname Field" into theText
put the number of lines in theText into theLines
delete line (lineSelected + 1) to theLines of field ¼
"Pathname Field"
end scrubPaths
------------------------------------------------------
-- Handler to delete all lines before the selection
on scrubMovieRefs
global lineSelected
put the text of field "History Field" into theText
put the number of lines in theText into theLines
delete line (lineSelected + 1) to theLines of field ¼
"History Field"
end scrubMovieRefs
------------------------------------------------------
-- When the MIAW recieves new info on the last movie
-- the reference and pathname are updated to text.
-- This handler hilites that new info.
on hiliteNewLine
global lineSelected
put the text of field "History Field" into theText
put the number of lines in theText into theLines
hilite line theLines of field "History Field"
updateStage
set lineSelected = theLines
end hiliteNewLine
------------------------------------------------------
-- Handler called to tell the stage to hide this MIAW.
on hideThisMovie
tell the stage
goBackOne
end tell
end hideThisMovie
------------------------------------------------------
on setTextFormat
if the machineType <> 265 then
set helveticaText = "Helvetica"
else
set helveticaText = "Arial"
end if
if voidP(HelveticaText) = false then
set the textFont of field "History Field" = HelveticaText
end if
set the textSize of field "History Field" = 10
end setTextFormat